<?php 
//引进配置信息
include '../include/init.php';
//引入数据库配置信息
include '../include/mysql.config.php';
//引入公共函数
include '../include/common.fun.php';
islogin();

if ($_POST){
	$title=$_POST['title'];
	$author=md5($_POST['author']);

	if ($title&&$author) {
		$date=array(
			'admin_name' => $title,
			'admin_addtime' => time(),
			'admin_password' => $author
		);
		$db->insert('wd_admin',$date);
		alert('添加成功','admin_list.php');exit;
	}else{
		alert('添加失败');exit;
	}
}


include 'view/admin_add.php';